<% content_for :page_title do %>
  <h1>Create a stack</h1>
<% end %>

<div class="wrapper">
  <section>
    <div class="setting-section">
      <%= form_for @stack do |f| %>
        <div class="field-wrapper">
          <%= label_tag "Repo" %>
          <br>
          <%= Shipit.github.url %>
          /
          <%= f.text_field :repo_owner, placeholder: 'e.g. Shopify', required: true, class: "repo" %>
          /
          <%= f.text_field :repo_name, required: true, pattern: "^[a-zA-Z0-9\-_\.]+$", class: "repo" %>
        </div>
        <div class="field-wrapper">
          <%= f.label :branch %>
          <%= f.text_field :branch, placeholder: '<default branch>' %>
        </div>
        <div class="field-wrapper">
          <%= f.label :environment %>
          <%= f.text_field :environment, placeholder: 'production' %>
        </div>
        <div class="field-wrapper">
          <%= f.label :deploy_url %>
          <span class="form-hint"><small>Where is this stack deployed to?</small></span>
          <%= f.text_field :deploy_url, placeholder: 'https://' %>
        </div>
        <div class="field-wrapper">
          <%= f.check_box :ignore_ci %>
          <%= f.label :ignore_ci, "Allow deploys regardless of CI status" %>
        </div>
        <div class="field-wrapper"><%= f.submit class: 'btn' %></div>
      <% end %>
    </div>
  </section>
</div>
